package com.logistics.security;

/**
 * 租户上下文工具类
 */
public class TenantContext {
    
    private static final ThreadLocal<Long> tenantIdHolder = new ThreadLocal<>();
    
    /**
     * 设置租户ID
     */
    public static void setTenantId(Long tenantId) {
        tenantIdHolder.set(tenantId);
    }
    
    /**
     * 获取租户ID
     */
    public static Long getTenantId() {
        return tenantIdHolder.get();
    }
    
    /**
     * 清除租户ID
     */
    public static void clear() {
        tenantIdHolder.remove();
    }
}
